﻿namespace Foundation.Sugar
{
    public static class General
    {
        public static bool Is<TItem>(this object o)
        {
            return o is TItem;
        }

        public static TItem As<TItem>(this object o) where TItem : class
        {
            return o as TItem;
        }

        public static TItem Of<TItem>(this object o)
        {
            return (TItem)o;
        }
    }
}
